#include <iostream>
#include <queue>
#define int long long
#define endl '\n'
using namespace std;
inline int read(){
    int x(0),f(1);
    char ch=getchar();
    while(ch<'0'||ch>'9'){
        if(ch=='-')f=-1;
        ch=getchar();
    }
    while('0'<=ch&&ch<='9'){
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    return x*f;
}
priority_queue<int,vector<int>,greater<int> >q1,q2;
signed main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n=read();
    for(int i=1,x;i<=n;i++) x=read(),q1.push(x);
    while(!q1.empty()){
        int x=q1.top(); q1.pop();
        if(!q2.empty())
            if(x>q2.top()) q2.pop();
        q2.push(x);
    }
    cout<<q2.size();
    return 0;
}
